package com.heima.common.util;


import com.heima.common.dto.User;

public class MediaThreadLocalUtil {

    private static ThreadLocal<User> threadLocal=new ThreadLocal<>();

    /**
     * 设置用户
     * @param user
     */
    public static void set(User user){
        threadLocal.set(user);
    }

    /**
     * 得到用户
     * @return
     */
    public static User get(){
        return threadLocal.get();
    }

    /**
     * 释放
     */
    public static void remove(){
        threadLocal.remove();
    }
}
